<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST">
    <input type="hidden" name="row[scenario]" value="edit">
    {if condition="!$shopId"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('限定门店')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-shop_ids" class="form-control selectpage" type="text"  name="row[shop_ids]" value="{$row.shop_ids|htmlentities}" title="" data-multiple="true" data-source="yunfood/shop/main/index">
        </div>
    </div>
    {else /}
    <input type="hidden" name="row[shop_ids]" value="{$row.shop_ids|htmlentities}">
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('位置')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[position]', $positionList, $row['position'], ['class'=>'form-control selectpicker'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('标题')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" type="text" name="row[title]" value="{$row.title|htmlentities}" title="" data-rule="required">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('图片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image_url" class="form-control" type="text"  name="row[image_url]" value="{$row.image_url|htmlentities}" title="" data-rule="required">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image_url" class="btn btn-danger faupload" data-input-id="c-image_url" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image_url"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image_url" class="btn btn-primary fachoose" data-input-id="c-image_url" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image_url"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image_url"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('跳转类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[redirect_type]', $redirectTypeList, $row['redirect_type'], ['class'=>'form-control selectpicker', 'id'=>'c-redirect_type'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('跳转内容')}:</label>
        <div id="box-link-data" class="box-cont col-xs-12 col-sm-8{$row.redirect_type === 'link' ? '': ' hide'}">
            <input id="c-link_url" class="form-control" type="text" name="row[linkData][url]" value="{$row.linkData.url|default=''|htmlentities}" title="">
        </div>
        <div id="box-page-data" class="box-cont col-xs-12 col-sm-8{$row.redirect_type === 'page' ? '': ' hide'}">
            <input id="c-page_url" class="form-control" type="text" name="row[pageData][page]" value="{$row.pageData.page|default=''|htmlentities}" title="">
        </div>
        <div id="box-source-data" class="box-cont col-xs-12 col-sm-8{$row.redirect_type === 'source' ? '': ' hide'}">
            <div class="form-inline" data-toggle="cxselect" data-selects="type,model">
                <select class="type form-control" name="row[sourceData][type]" title="" data-url="yunfood/common/typeModel?group=type">
                    {notempty name="row.sourceData.type"}
                    <option value="{$row.sourceData.type|htmlentities}" selected></option>
                    {/notempty}
                </select>
                <select class="model form-control" name="row[sourceData][model_id]" title="" data-url="yunfood/common/typeModel?group=model" data-query-name="source">
                    {notempty name="row.sourceData.model_id"}
                    <option value="{$row.sourceData.model_id|htmlentities}" selected></option>
                    {/notempty}
                </select>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-note" class="form-control" type="text" name="row[note]" value="{$row.note|htmlentities}" title="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', $statusList, $row['status'], ['class'=>'form-control selectpicker'])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button class="btn btn-success btn-embossed disabled" type="submit">{:__('OK')}</button>
            <button class="btn btn-default btn-embossed" type="reset">{:__('Reset')}</button>
        </div>
    </div>
</form>